package com.bqtt.tumor.demo.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bqtt.tumor.demo.common.utility.InlineTools;


@Entity
@Table(name="city_def") 
public class City  implements IDBEntity{

	@Id 
    @Column(name="city_def_id")    
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
	private Integer city_def_id;
	
	@Column(name="city_name",length=150)   
	private String city_name;
	@Column(name="province",length=100)   
	private String province;

	
	@Transient
	private String displayName;
	
	
	public City(Integer city_def_id, String city_name, long city_code,
			String province) {
		super();
		this.city_def_id = city_def_id;
		this.city_name = city_name;
		this.province = province;
	}

	public City() {
		super();
		displayName ="none";
		// TODO Auto-generated constructor stub
	}

	public Integer getCity_def_id() {
		return city_def_id;
	}

	public void setCity_def_id(Integer city_def_id) {
		this.city_def_id = city_def_id;
	}

	public String getCity_name() {
		return city_name;
	}

	public void setCity_name(String city_name) {
		this.city_name = city_name;
	}



	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}
	
	
	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	/**  获取SQL有效的非空的字段
	 * @return
	 */
	public Map<String,Object> getSQLValidAttributes()
	{
		Map<String,Object> result = new HashMap<String,Object>();
		
		if(!InlineTools.isEmpty(city_name))
		{
			result.put("city_name", city_name);
		}
		
		if(!InlineTools.isEmpty(province))
		{
			result.put("province", province);
		}

		return result;
	}

	@Override
	public void fillStringField() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fillDBfields() {
		// TODO Auto-generated method stub
		
	}
	
	
	
	
}
